package com.ssm.dao;

import com.ssm.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Date;
import java.util.List;

public interface UserMapper {
    //根据Id查询用户
    public User getUserById(@Param("id") Integer id);
    //根据用户编码查用户
    public User getUserByUserCode(@Param("userCode") String userCode);
    //获取用户列表
    public List<User> getUserList(@Param("userName") String userName, @Param("userRole") Integer userRole, @Param("offset") int offset, @Param("pageSize") int pageSize);
    //获得要登录的用户
    public User getLogin(User user);
    //修改当前用户的密码
    public int updatePwd(@Param("id") Integer id,@Param("newPassword") String newPassword) throws SQLException;
    //根据用户名或者角色查询查询用户总数
    public int getUserCount(@Param("userName") String userName,@Param("userRole") Integer userRole) throws SQLException;
    //添加一个用户
    public int addUser(User user);
    //删除一个用户
    public int deleteUserById(@Param("id") Integer id) throws SQLException;
    //修改一个用户的信息
    public int modifyUser(User user) throws SQLException;
}
